fix(locale): weight common chinese surnames more frequently#3467
fix(locale): weight common chinese surnames more frequently#3467matthewmayer wants to merge 4 commits intofaker-js:nextfrom
Conversation
✅ Deploy Preview for fakerjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #3467 +/- ##
=======================================
Coverage 98.89% 98.89%
=======================================
Files 887 887
Lines 3064 3064
Branches 556 556
=======================================
Hits 3030 3030
Misses 30 30
Partials 4 4 🚀 New features to boost your workflow:
|
| @@ -1,4 +1,26 @@ | |||
| export default { | |||
| generic_common: [ | |||
There was a problem hiding this comment.
I'm not sure about this extra key as it is not included in the module definitions type contract. I'd be in favor to allow (not enforce!) weighted lists in the name schemas in general. I could see this being introduced as a workaround at most for now.
|
zh_TW (Taiwan) also only includes a subset of common surnames, and it works quite well. so I think zh_CN could do the same — weighting may not be necessary (consider If you're aligned with this idea, I'm happy to submit a PR for the change (pick surnames), which would only change the locals. |
|
I'm not 100% sure this is the best approach (versus just using common surnames) though I'd say the fact that generic_common is not in the module definition is not enough to disqualify it as an approach, there are plenty of other edge cases in the locales which use non-standard keys. For example company.legal_entity_type and company.category used in various definitions and locales. |
|
For me, both weighting and/or reducing the number of rare last names in that list are valid sulutions. |
|
Looks like you have to run preflight on this PR once more. |
POC to fix #3466
Weights 20 common Chinese surnames to appear 80% of the time